package com.snail.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.snail.mapper.BizRefundRequestMapper;
import com.snail.mapper.MerchantRefundOrderMapper;
import com.snail.model.pojo.cart.BizRefundRequest;
import com.snail.service.MerchantRefundOrderService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MerchantRefundOrderServiceImpl implements MerchantRefundOrderService {

    // 注入原生MyBatis的Mapper接口
    @Resource
    private BizRefundRequestMapper refundRequestMapper;
    @Resource
    private MerchantRefundOrderMapper merchantRefundOrderMapper;

    @Override
    public IPage<BizRefundRequest> selectMerchantRefunds(Page<BizRefundRequest> page, BizRefundRequest refundRequest) {
        // 调用mapper层方法进行分页查询
        return merchantRefundOrderMapper.selectMerchantRefunds(page, refundRequest);
    }

    @Override
    public BizRefundRequest getRefundById(Long refundId) {

       return null;
    }

    @Override
    public void handleRefund(BizRefundRequest refundRequest) {
        return ;
    }

    @Override
    public void insertRefund(BizRefundRequest refundRequest) {
        merchantRefundOrderMapper.insertRefund(refundRequest);

    }

    @Override
    public void updateRefund(BizRefundRequest refundRequest) {
        merchantRefundOrderMapper.updateRefund(refundRequest);
    }
}
